﻿import kliment.net.URLTarget;
import kliment.utils._Object;
/**
 * ...
 * @author	Kliment
 * @version	1.2.0
 */
class kliment.net.URL {
	
	static public function navigate(url:String, data:Object, method:String, target:String):Boolean {
		var sendVars:LoadVars = _createSender(data);
		return sendVars.send(url,  target || URLTarget.SELF, method);
	}
	
	static public function send(url:String, data:Object, method:String, target:String):Boolean {
		var sendVars:LoadVars = _createSender(data);
		return sendVars.sendAndLoad(url,  target || URLTarget.SELF, method);
	}
	
	static private function _createSender(data:Object):LoadVars {
		var sendVars:LoadVars = new LoadVars();
		_Object.copyTo(data, sendVars);
		return sendVars;
	}
}